<template>
  <div class="person">
    <h2>人员信息</h2>
    <h4>姓名：{{personName}}</h4>
    <h4>年龄：{{personAge}}</h4>
    <button @click="showPersonInfo">点我提示个人信息</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    data(){
      return {
        personName:'老段',
        personAge:90,
      }
    },
    methods:{
      showPersonInfo(){
        alert(`我叫${this.personName}，我今年${this.personAge}岁了`)
      }
    }
  }
</script>

<style>
  .person {
    background-color: skyblue;
    box-shadow: 0 0 10px;
    padding: 10px;
    border-radius: 10px;
  }
</style>